package com.dji.sample.manage.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dji.sample.manage.model.entity.LiveInfoEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @author yjt
 * @date 2022-10-17
 * @description:
 */
public interface LiveInfoMapper extends BaseMapper<LiveInfoEntity> {

    @Update(value = "update live_info set file_path=#{filePath},file_ip=CONCAT(file_ip,',',#{ip}),audio_ip=CONCAT(audio_ip,',',#{ip}),audio_file_path=#{audioFilePath},audio_url=#{audioUrl} where id =#{id}")
    int updateDvrById(@Param(value = "id") Long id, @Param(value = "ip") String ip, @Param(value = "filePath") String filePath, @Param(value = "audioFilePath") String audioFilePath, @Param(value = "audioUrl") String audioUrl);

    @Update(value = "update live_info set file_path=#{filePath},file_ip=CONCAT(file_ip,',',#{ip}),audio_ip=CONCAT(audio_ip,',',#{ip}),audio_file_path=#{audioFilePath},audio_url=#{audioUrl} where id =#{id}")
    int updateReplyById(@Param(value = "id") Long id, @Param(value = "ip") String ip, @Param(value = "filePath") String filePath, @Param(value = "audioFilePath") String audioFilePath, @Param(value = "audioUrl") String audioUrl);

    @Update(value = "update live_info set file_path=#{filePath},file_ip=#{ip},audio_ip=#{ip},audio_file_path=#{audioFilePath},audio_url=#{audioUrl} where id =#{id}")
    int updateIpsDvrById(@Param(value = "id") Long id, @Param(value = "ip") String ip, @Param(value = "filePath") String filePath, @Param(value = "audioFilePath") String audioFilePath, @Param(value = "audioUrl") String audioUrl);

}
